//
//  CXTopView.m
//  TestFace2
//
//  Created by 曹想 on 2019/3/1.
//  Copyright © 2019 ShangHaiXinLaWangLuoKeji. All rights reserved.
//

#import "CXTopView.h"
#define KscreenWidth [[UIScreen mainScreen]bounds].size.width
#define KscreenHeight [[UIScreen mainScreen]bounds].size.height

@interface CXTopView ()<CXLoginLodingViewDelegate>

@property (nonatomic,strong) UIImageView * iconGroundImage;//底部view

@property (nonatomic,strong) UIButton * faceBtn;//facebook登录

@property (nonatomic,strong) UIButton * guestBtn;//游客登录

@end


@implementation CXTopView

+(instancetype)initCXTopView{
    CXTopView * topView = [[CXTopView alloc]initWithFrame:CGRectMake(0, 0, KscreenWidth, KscreenHeight)];
    return topView;
}

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        UIImageView * imageIcon = [[UIImageView alloc]initWithFrame:self.bounds];
       // imageIcon.image = [UIImage imageNamed:[[FaceLoginAndShareManager sharedInstance]getReplaceHolder]];
        [self addSubview:imageIcon];
        self.iconGroundImage = imageIcon;
    }
    return self;
}

#pragma mark --背景+lodingView
-(void)showLodingSelfView{
    CXLoginLodingView * loginView = [CXLoginLodingView shareInstanceView];
    loginView.center = CGPointMake(self.center.x, self.center.y);
    loginView.delegate = self;
    [self addSubview:loginView];
    self.lodingView = loginView;
}

#pragma mark --只显示背景图
-(void)hiddenLodingSelfView{
    
}



#pragma mark --CXLoginLodingViewDelegate

-(void)faceLoginClick{
    if (self.delegate && [self.delegate respondsToSelector:@selector(topFaceClick)]) {
        [self.delegate topFaceClick];
    }
}


-(void)guestLoginClick{
    if (self.delegate && [self.delegate respondsToSelector:@selector(topGuestClcik)]) {
        [self.delegate topGuestClcik];
    }
}


@end
